<!-- 活动管理 -->
<?php $id="form_".uniqid();?>
<table id="<?php echo $id;?>"></table>
<script>
$("#<?php echo $id;?>").DataSource({url:'setting/get_activity_list?type=<?php echo $type?>',
	fields:[[
		{field:'id',title:'ID ',      width:110, align:'center',sortable:false},
		{field:'picture',title:'缩略图',      width:240, align:'center', sortable:true,},
		{field:'title',title:'标题 ',      width:110, align:'center',sortable:true},	
		{field:'position',title:'显示终端',   width:110, align:'center', sortable:true},
		{field:'release_time',title:'发布时间',   width:110, align:'center', sortable:true},
		{field:'deadline',title:'过期时间',   width:200, align:'center', sortable:true},		
		{field:'op', title:'操作', width:370,align:'center',sortable:false,formatter:function(v,r){
			return '<a herf="#" class="btn btn-danger btn-xs" onclick=Core.confirm("<?php echo $id;?>",1,"asd","确定停用该会员使用?")>启用</a>&nbsp;&nbsp;'+
			'<a herf="#" class="btn btn-danger btn-xs" onclick=Core.confirm("<?php echo $id;?>",1,"asd","确定停用该会员使用?")>停用</a>&nbsp;&nbsp;'+
			'<a herf="#" class="btn btn-danger btn-xs" onclick=Core.confirm("<?php echo $id;?>",1,"asd","确定停用该会员使用?")>删除</a>&nbsp;&nbsp;';
		}}
    ]],
    tools:[
        {instant:false},
        <?php if(in_array('ADD',$auth)){?>
        {text:"新增",iconCls:"icon-add",handler:function(){
            $('#<?php echo $id?>').DataSource('add',{title:'新增优惠活动',get:'setting/activity_con_set',full:true});
        }}
        <?php }?>
    ],

	checkbox:false,
   	footer:true,
	pagination:{layout:['links','last'],showRefresh:false},
	success:function(){
		$('#<?php echo $id?>').pagination({layout:['links','last'],showRefresh:false});
	}
});
</script>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
	<div class="modal-dialog" role="document">
	    <div class="modal-content">
	      <div class="modal-body">
	        <img src="static/images/blank.jpg" alt="">
	      </div>
	      <div class="modal-footer">
	        <button type="button" style="padding:2px 12px;" class="btn btn-default" data-dismiss="modal">关闭</button>
	      </div>
	    </div>
  </div>
</div>
